package com.caiyj.strategy;

/**
 * @Description:
 * @author:CAIYJ
 * @Date:2018/12/14 21:30
 */
public class Application {

    public static void main(String[] args) {
        int[] array = {1, 2, 3, 4, 5};
        Context context = new Context();
        ConcreteStrategyA a = new ConcreteStrategyA();
        ConcreteStrategyB b = new ConcreteStrategyB();
        context.setStrategy(a);
        System.out.println(context.getResult(array));
        context.setStrategy(b);
        System.out.println(context.getResult(array));
    }
}
